<?php  
	$additionElements = $this->getAdditionalFilterElements();
	$filters = $this->getFilters(); 
?>
<div >  
<p>Filter:</p> 
<form id="<?php echo $this->getHtmlIds('filters_form') ?>"  name="filters_form_<?php echo $this->getId();?>" >

<?php
	$elementName='model['.$this->getModelName().'][filter]';  
	foreach ($filters as $f)
	{ 
		?>
		<p class="filterElement" >
		<?php 
		$f['filter']->setAttribute('id',$f['filter']->getAttribute('name').'_'.$this->getId());
		$f['filter']->setAttribute('name',$elementName.'['.$f['filter']->getId().'][value]');
	 	echo $f['filter']->generateView(); 
	 	?> 
		<input type="hidden" name="<?php echo $elementName.'['.$f['filter']->getId().'][data]'?>" value='<?php echo json_encode($f['data'])?>' />
		</p>
		<?php 
	}
	foreach ($additionElements as $a)
	{
		echo $a->generateView(); 
	} 
?>
<input type="hidden" name="model[<?php echo $this->getModelName()?>][filterGroupOperators]" value='<?php echo json_encode($this->getFilterGroupsOperators());?>' />
<input type="hidden" id="<?php echo $this->getHtmlIds('limitStart') ?>" name ="model[<?php echo $this->getModelName()?>][limitStart]" />
<input type="hidden"  id="<?php echo $this->getHtmlIds('limitEnd') ?>" name="model[<?php echo $this->getModelName()?>][limitEnd]" />
<input type="hidden" id="<?php echo $this->getHtmlIds('sortBy') ?>" name="model[<?php echo $this->getModelName()?>][sortBy]" />
<input type="hidden"  name="model[<?php echo $this->getModelName()?>][count]" value="1" />
<input type="button" id="<?php echo $this->getHtmlIds('filterButton') ?>" value="Filter" />
</form> </div> 
<div>
<input type="button" id="<?php echo $this->getHtmlIds('add') ?>" value="Add" />
</div> 

 